#读取json文件内容

import json

with open(r'Bookkeeping.json',mode='r',encoding='utf-8') as f:
    data=json.load(f)
    print(data)

# 写入json数据
data_list=[{'time':'2030/8/21 21:00:00','project':'工资','classify':'收入','amount':1000},
           {'time':'2030/9/21 21:00:00','project':'工资','classify':'收入','amount':1000}]

with open(r'Bookkeeping.json',mode='w',encoding='utf-8') as f:
    json.dump(data_list,f,ensure_ascii=False)